using System;
using System.ComponentModel;

namespace WebRSSBuilder.Core
{
	/// <summary>
	/// A news topic in an RSS feed.
	/// </summary>
    [DataObject(true)]
	public class RSSItem: INotifyPropertyChanged
	{

      #region Private Data Members 
        private string title = "New Topic";
        private string link = "http://";
        private string guid = "";
        private bool isPermaLink = true;
        private string comments = "";
        private string author = "";
        private string description = "";
        private DateTime pubDate;
        private string category = "";
        private string enclosureUrl = "";
        private string enclosureLength = "";
        private string enclosureType = "";
        private string valid = "";
        private string identifier = "";
        private int timeOffset ;  
        #endregion
      #region Properties
      public string Title
      {
          get { return title; }
          set { title = value; OnPropertyChanged("Title"); }
      }

      public string Link
      {
          get { return link; }
          set { link = value; OnPropertyChanged("Title"); }
      }

      public string GUID
      {
          get { return guid; }
          set { guid = value; OnPropertyChanged("Title"); }
      }

      public bool IsPermaLink
      {
          get { return isPermaLink; }
          set { isPermaLink = value; OnPropertyChanged("Title"); }
      }

      public string Category
      {
          get { return category; }
          set { category = value; OnPropertyChanged("Title"); }
      }

      public string Description
      {
          get { return description; }
          set { description = value; OnPropertyChanged("Title"); }
      }

      public DateTime PubDate
      {
          get { return pubDate; }
          set { pubDate = value; OnPropertyChanged("Title"); }
      }

      public int TimeOffset
      {
          get { return timeOffset; }
          set { timeOffset = value; OnPropertyChanged("Title"); }
      }

      public string Author
      {
          get { return author; }
          set { author = value; OnPropertyChanged("Title"); }
      }

      public string Comments
      {
          get { return comments; }
          set { comments = value; OnPropertyChanged("Title"); }
      }

      public string EnclosureUrl
      {
          get { return enclosureUrl; }
          set { enclosureUrl = value; OnPropertyChanged("Title"); }
      }

      public string EnclosureLength
      {
          get { return enclosureLength; }
          set { enclosureLength = value; OnPropertyChanged("Title"); }
      }

      public string EnclosureType
      {
          get { return enclosureType; }
          set { enclosureType = value; OnPropertyChanged("Title"); }
      }

      public string Valid
      {
          get { return valid; }
          set { valid = value; OnPropertyChanged("Title"); }
      }
      public string Identifier
      {
          get { return identifier; }
          set { identifier = value; OnPropertyChanged("Title"); }
      } 
      #endregion
      #region constructor 
      public RSSItem()
      {
      }
      #endregion
      #region NotifyPropertyChange

      public event PropertyChangedEventHandler PropertyChanged;
      public void OnPropertyChanged(string PropertyName)
      {
          if (PropertyChanged != null)
              PropertyChanged(this, new PropertyChangedEventArgs(PropertyName));
      } 
      #endregion
    }
}
